package com.example.gmallconsumerdubbospringboot.controller;

import com.example.gmallinterfacedubbospringboot.rr.pojo.UserAddress;
import com.example.gmallinterfacedubbospringboot.rr.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author : RENBIAO
 * @createTime : 2021/7/12 20:11
 */
@Controller
public class OrderController {

    @Autowired
    OrderService orderService;

    @ResponseBody   //返回结果是JSON形式，显示在页面上
    @RequestMapping("/initOrder")   //访问url
    public List<UserAddress> initOrder(@RequestParam("uid") String userId){
        return orderService.initOrder(userId);
    }
}
